# Create your views here.
from django.http import HttpResponse
from django.shortcuts import render


# Create your views here.

def index(request):
    # 返回一个字符串
    # return  HttpResponse("<h1>welcome python zhangyu</h1>")
    # 返回页面;第一次参数是request；第二个参数是在templates目录下的文件；不需要导入；直接写就可以
    context = {}
    context["hello"] = "hello world !"
    return render(request, "index.html", context)


def index2(request):
    return render(request, "index.html", {"hello": "hello world 2!"})


def index_list(request):
    list = [1, 2, 3]
    return render(request, "index.html", {"hello": list})
